package com.example.my.meila.presenter;

import com.example.my.meila.api.BaseSubscriber;
import com.example.my.meila.api.ExceptionHandle;
import com.example.my.meila.entity.Global;
import com.example.my.meila.entity.Paihangbang;
import com.example.my.meila.model.ModelFactory;
import com.example.my.meila.view.impl.GlobalView;
import com.example.my.meila.view.impl.RankView;

/**
 * Created by My on 2016/10/31.
 */
public class RankPresenter {
    public RankView rankView;

    public RankPresenter(RankView rankView) {
        this.rankView = rankView;
    }

    public void getRankData() {
        ModelFactory.getiRankModel().getRankData(new BaseSubscriber<Paihangbang>() {
            @Override
            public void onSuccess(Paihangbang paihangbang) {

                rankView.onSuccess(paihangbang);
            }

            @Override
            public void onFail(ExceptionHandle.ResponeThrowable e) {
                rankView.onFail(e);
            }

            @Override
            public void onFinished() {
                rankView.onFinish();
            }
        });
    }
}
